package explorandum.g2;

import java.awt.Color;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Random;

import explorandum.Logger;
import explorandum.Move;
import explorandum.Player;
import explorandum.g2.Team2;
import explorandum.GameConstants;

public class StepLike {
	
	
	public static Move getMove(Point currentLocation, Point[] offsets, Boolean[] hasExplorer, Integer[][] otherExplorers, Integer[] terrain, int time,int n, int p, int d, int myID, ArrayList<Point> stepped, int _dx[],int _dy[], Random rand)
	{
		
		ArrayList<Integer> val =new ArrayList<Integer>();
				int k =1;
				while(k<=7)
				{
					if(_dx[k]!=0||_dy[k]!=0)
					{
						for(int i=0;i<offsets.length;i++)
						{
							if(terrain[i]==0)
							{
								Point point=offsets[i];
								if(point.x == currentLocation.x + _dx[k] && point.y == currentLocation.y + _dy[k]  )
								{
									val.add(k);
									if(!(stepped.contains(point)))
									{
									return new Move(k);
									}
									
								}
							}
						}
					}
				k+=2;	
				}
				
			
		System.out.println("The size is "+ val.size());
		return new Move(val.get(rand.nextInt(val.size())));
		
		
	
	}

}
